package cn.wolfcode.luowowo.website.util;

import cn.wolfcode.luowowo.acticle.domain.Destination;
import cn.wolfcode.luowowo.acticle.service.IDestinationService;
import org.springframework.ui.Model;

import java.util.List;

/**
 * 共享toasts吐司数据工具类
 */
public class ToastsUtil {
   public static void addAttibuteByDestId(Model model, IDestinationService destinationService, Long destId){
       //toasts
       List<Destination> toasts = destinationService.getToasts(destId);
       Destination dest = toasts.remove(toasts.size() - 1);
       model.addAttribute("toasts", toasts);
       //dest
       model.addAttribute("dest", dest);

   }
}
